<?xml version="1.0" encoding="UTF-8"?>
<beans
	xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
	
  
	<!-- compass2.2 config start -->
	<bean id="annotationConfiguration" class="org.compass.annotations.config.CompassAnnotationsConfiguration"></bean>
	<bean id="compass" class="org.compass.spring.LocalCompassBean">
		<!-- 定义索引的存储位置
		<property name="resourceDirectoryLocations">
			<list>
				<value>classpath:com/soft/SearchEngines</value>
			</list>
		</property>
		
		<property name="connection">
            <value>/lucene/indexes</value>
        </property>
		 -->
		
		<!-- anontaition式设置  -->
		<property name="classMappings">
			<list>
				<!-- 知识中心类-->
				<value>cn.firstsoft.modules.knowledge.vo.KnowledgesIndexVO</value>
				<value>cn.firstsoft.modules.knowledge.vo.KnowledgeAttachIndexVO</value>
				<value>cn.firstsoft.modules.knowledge.domain.KnowledgeCatalogyType</value>
				<value>cn.firstsoft.modules.knowledge.domain.KnowledgeCatalogy</value>
				<value>org.springside.modules.security.domain.User</value>
				<!-- 新闻中心类-->
				<value>cn.firstsoft.modules.news.vo.NewsIndexVO</value>
				<value>cn.firstsoft.modules.news.vo.NewsAttachIndexVO</value>
				<value>cn.firstsoft.modules.news.domain.NewsCatalogy</value>
				<!-- 通知公告中心类-->
				<value>cn.firstsoft.modules.bulletin.vo.BulletinsIndexVO</value>
				<value>cn.firstsoft.modules.bulletin.vo.BulletinsAttachIndexVO</value>
				<!-- value>cn.firstsoft.modules.bulletin.domain.BulletinsCategory</value-->
			</list>
		</property>
		<property name="compassConfiguration" ref="annotationConfiguration"/>
		<property name="compassSettings">
			<props>
				<!-- 建立索引位置的另一种方式   --> 
                <prop key="compass.engine.connection"> 
                    file://${constant.main_storage_dir}/lucene/indexes  
                </prop>  
                
                <prop key="compass.transaction.processor">async</prop> 
                <prop key="compass.engine.mergeFactor">100</prop> 
				<prop key="compass.engine.maxBufferedDocs">1000</prop> 
				<prop key="compass.engine.maxFieldLength">100000</prop>
				<prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop>
				<prop key="compass.engine.highlighter.default.formatter.simple.pre"><![CDATA[<span style='color:red;'>]]></prop>
				<prop key="compass.engine.highlighter.default.formatter.simple.post"><![CDATA[</span>]]></prop>
				<!-- 指定摘要文本的长度 -->  
                <prop key="compass.engine.highlighter.default.fragmenter.simple.size">200</prop>
				<!-- 定义分词器 -->
                <prop key="compass.engine.analyzer.default.type">net.paoding.analysis.analyzer.PaodingAnalyzer</prop> 
			</props>  
		</property>  
		<property name="transactionManager" ref="transactionManager"/>
		<!-- 附件属性转换器 
		<property name="convertersByName">  
            <map>  
                <entry key="attachmentPropertyConverter">  
                    <bean class="cn.firstsoft.firstframe.plugins.compass.constants.AttachmentPropertyConverter"/>  
                </entry>  
            </map>  
        </property>
		-->
	</bean>
	<!-- bean id="hibernateGpsDevice" class="org.compass.spring.device.hibernate.dep.SpringHibernate3GpsDevice"-->
	<bean id="hibernateGpsDevice" class="org.compass.gps.device.hibernate.HibernateGpsDevice">
		<property name="name" value="hibernateDevice"/>
		<property name="sessionFactory" ref="sessionFactory"/>
		<property name="mirrorDataChanges" value="true"/>
	
	</bean>
	<!-- 同步更新索引 -->
	<bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps" destroy-method="stop">  
		<property name="compass" ref="compass"/>  
		<property name="gpsDevices">  
			<list>  
				<ref local="hibernateGpsDevice"/>  
			</list>   
		</property>
	</bean>	
	<!-- compass模板 -->
	<bean id="compassTemplate" class="org.compass.core.CompassTemplate">
		<property name="compass" ref="compass" />
	</bean>
	<!-- 定时重建索引(利用quartz)或随Spring ApplicationContext启动而重建索引 -->
	<bean id="compassIndexBuilder" class="cn.firstsoft.firstframe.plugins.compass.service.logic.CompassIndexBuilderManager" lazy-init="false">
		<property name="compassGps" ref="compassGps" />
		<property name="buildIndex" value="false" />
		<property name="startGps" value="${constant.compassSearchSwitch}"/> 
		<property name="compassTemplate" ref="compassTemplate" />
	</bean>
	<!-- compass2.2 config end -->
</beans>